$(document).ready(function(){
	CHANGE_TYPE();//查询资产类型
	cw.common.getUserSession(loadT_FA_CHANGE_FLOW);
})

//查询变更类型
var CHANGE_TYPE = function(){
	cw.common.getDictByPage('CHANGE_TYPE','','#CHANGE_TYPE',printFIXED_ASSETS_TYPE)
}
var printFIXED_ASSETS_TYPE = function(obj,result,i){
	$(result).append('<option value="'+obj.TYPE_ID+'">'+obj.TYPE_NAME+'</option>');
}

//载入资产变更信息
function loadT_FA_CHANGE_FLOW(){
	var BARCODE=$("#BARCODE").val();
	if(BARCODE==undefined)BARCODE="";
	
	var CHANGE_TYPE=$("#CHANGE_TYPE").val();
	
	var url = cw.common.path + '/json?action=QUERY_T_FA_CHANGE_FLOWBYPAGER_ACTION';
	url += "&BARCODE="+BARCODE+"&CHANGE_TYPE="+CHANGE_TYPE;
	var xmlname = "T_FA_CHANGE_FLOW";
	var pagePanel='#T_FA_CHANGE_FLOW_pager';
	var result='#T_FA_CHANGE_FLOW_LIST';
	var pageSize=10;
	var defaultHtml='<li><em style="text-align: center;width:100%">没有搜索到您要查询的数据...</em></li>';
	cw.common.changePage(url,pageSize,xmlname,result,fn_queryT_FIXED_ASSETS_DETAILLIST,pagePanel,defaultHtml);
}
var fn_queryT_FIXED_ASSETS_DETAILLIST = function(obj,result,i){
	
	var BEFOR_PRICE =obj.BEFOR_PRICE;
	var AFTER_PRICE = obj.AFTER_PRICE;
	if(BEFOR_PRICE==''||BEFOR_PRICE=='null'||BEFOR_PRICE==null)BEFOR_PRICE='';
	if(AFTER_PRICE==''||AFTER_PRICE=='null'||AFTER_PRICE==null)AFTER_PRICE='';
	var str='<li id="bar_'+obj.BARCODE+'">';
	str+='<em style="width: 10%; text-align: center;">'+obj.BARCODE+'</em>';
	str+='<em style="width: 10%; text-align: center;">'+obj.CHANGE_TYPE_NAME+'</em>';
	str+='<em style="width: 10%; text-align: center;">'+cw.common.toChar(obj.CHANGE_DATE,'yyyy-mm-dd')+'</em>';
	str+='<em style="width: 10%; text-align: center;">'+BEFOR_PRICE+'</em>';
	str+='<em style="width: 10%; text-align: center;">'+AFTER_PRICE+'</em>';
	str+='<em style="width: 10%; text-align: center;">'+obj.PERSON_NAME+'</em>';
	str+='<em style="width: 10%; text-align: center;">'+obj.REMARK+'</em>';
	str+='</li>';
	$(result).append(str);
}
